package spring.proxyfactorybean;

import dynamic.jdk.dao.TestDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author wangjinjing
 * @version 1.0
 * @date 2021/11/24 18:24
 */
public class ProxyFactoryBeanTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext
                ("/spring/proxyfactorybean/applicationContext.xml");
        // 从容器中获取增强后的对象
        TestDao testDaoAdvice = (TestDao)context.getBean("testDaoProxy");
        // 执行方法
        testDaoAdvice.save();
        System.out.println("============");
        testDaoAdvice.modify();
        System.out.println("============");
        testDaoAdvice.delete();
    }
}
